home *** CD-ROM | disk | FTP | other *** search
- /* absread.c --- p 547 */
- #include <stdio.h>
- #include <dos.h>
- void main(void)
- {
- int i, strt, ch_out, sector;
- char buf[512];
- printf("Insert a diskette into drive A and press any key\n");
- getch();
- /* Read logical sector 0. This "bootstrap"sector
- * contains informtion about the disk's
- * characteristics */
- sector = 0;
- if(absread(0,1,sector, &buf) != 0)
- {
- printf("Error in 'absread' !\n");
- exit(0);
- }
- printf("Read OK.\n");
- printf("OEM name and version from boot sector:\n");
- strt = 3;
- for(i=0;i<8;i++)
- {
- ch_out = buf[strt+i];
- putchar(ch_out);
- }
- printf("\n");
- }